//
//  ZWBaseButton.m
//  WanEr
//
//  Created by 高文萍 on 15/12/16.
//  Copyright © 2015年 高文萍. All rights reserved.
//

#import "ZWBaseButton.h"

@implementation ZWBaseButton

+ (ZWBaseButton *)baseButtonFrame:(CGRect)frame                  buttonType:(UIButtonType)buttonType                     buttonTitle:(NSString *)title buttonTitleColor:(UIColor *)color  buttonTag:(NSInteger)tag                buttonImage:(UIImage *)image
{
    ZWBaseButton *button=[UIButton buttonWithType:buttonType];
    
    
    
    button.frame=frame;
    if (title) {
        [button setTitle:title forState:UIControlStateNormal];
    }
    
    if (color) {
        [button setTitleColor:color forState:UIControlStateNormal];
    }
    if (tag) {
        button.tag=tag;
    }
    
    
    if (image)
    {
        if(buttonType==UIButtonTypeCustom)
            [button setImage:image forState:UIControlStateNormal];
        else
            [button setBackgroundImage:image forState:UIControlStateNormal];
        
    }
    
    
    return button;

}


@end
